#include "DualServerSendHandler.h"
#include "DualClientRecvHandler.h"

using namespace log4cplus;

Logger DualServerSendHandler::log=GetLogger(LOG4CPLUS_TEXT("DualServerSendHandler"));

void DualServerSendHandler::GetSendRecvInfo(ClientContext &client,SOCKET *sendSock,SOCKET *recvSock,WSABUF **buf,WSABUF **weakRefBuf,OVERLAPPED **ovl)
{
	unsigned int clienSequenceNo=client.SequenceNo();
	LOG4CPLUS_DEBUG_FMT(log,LOG4CPLUS_TEXT("[Client%d]Dual server send handler set sendrecv info."),clienSequenceNo);
	*sendSock=client.DestSock();
	*recvSock=client.SrcSock();
	*buf=client.Buffer();
	*weakRefBuf=client.WeakRefBuffer();
	*ovl=client.OVL();
}

void DualServerSendHandler::SetNextHandler(ClientContext &client)
{
	delete client.ExtContext().SetSrcHandler(new DualClientRecvHandler());
}